package com.lookme.lmtool.cracker.filter.color;

import com.jhlabs.image.ThresholdFilter;
import com.lookme.lmtool.cracker.CrackerConstants;
import com.lookme.lmtool.cracker.annotation.FilterAnnotation;
import com.lookme.lmtool.cracker.annotation.ParamAnnotation;
import com.lookme.lmtool.cracker.filter.AbstractFilter;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

import java.awt.image.BufferedImageOp;

@FilterAnnotation(groupName = CrackerConstants.FILTER_GROUP_NAME_COLOR,name="二值化",filterClass = ThresholdFilter.class)
public class FilterThreshold extends AbstractFilter {
    @XStreamAsAttribute
    @ParamAnnotation(name = "阀值", desc = "阀值",inputType = ParamAnnotation.InputType.Slider,width = 300,max=256)
    int threshold=127;

    @Override
    public BufferedImageOp getFilter() {
        return new ThresholdFilter(threshold);
    }
}
